<?php $campaigns = $sf_data->getRaw('campaigns') ?>
<?php $personalInfos = $sf_data->getRaw('personalInfos') ?>
<?php $companyInfos = $sf_data->getRaw('companyInfos') ?>
<?php $otherInfos = $sf_data->getRaw('otherInfos') ?>

<!-- Campaigns -->
<?php if(count($campaigns) > 0): ?>
<h2>Campaigns</h2>
<table>
	<thead>
		<tr>
    <?php foreach(array_keys($campaigns[0]) as $field): ?>
    	<th style="padding:5px 20px"><?php echo $field; ?></th>
    <?php endforeach; ?>
    </tr>
	</thead>
	<tbody>
<?php foreach($campaigns as $campaign): ?>
		<tr>
      <?php foreach($campaign as $val): ?>
      <td><?php echo $val; ?></td>
      <?php endforeach; ?>
	  </tr>
<?php endforeach; ?>
  </tbody>
</table>
<?php endif; ?>

<!-- Personal Information -->
<?php if(count($personalInfos) > 0): ?>
<h2>Personal Information</h2>
<table>
  <thead>
    <tr>
    <?php foreach(array_keys($personalInfos[0][0]) as $field): ?>
      <th style="padding:5px 20px"><?php echo $field; ?></th>
    <?php endforeach; ?>
    </tr>
  </thead>
  <tbody>
<?php foreach($personalInfos as $personalInfoArray): ?>
	<?php foreach($personalInfoArray as $personalInfo): ?>
    <tr>
    <?php foreach ($personalInfo as $val): ?>
      <td><?php echo $val; ?></td>
    <?php endforeach; ?>
    </tr>
  <?php endforeach; ?>
<?php endforeach; ?>
  </tbody>
</table>
<?php endif; ?>

<!-- Company Information -->
<?php if(count($companyInfos) > 0): ?>
<h2>Company Information</h2>
<table>
  <thead>
    <tr>
    <?php foreach(array_keys($companyInfos[0][0]) as $field): ?>
      <th style="padding:5px 20px"><?php echo $field; ?></th>
    <?php endforeach; ?>
    </tr>
  </thead>
  <tbody>
<?php foreach($companyInfos as $companyInfoArray): ?>
	<?php foreach($companyInfoArray as $companyInfo): ?>
    <tr>
    <?php foreach ($companyInfo as $val): ?>
      <td><?php echo $val; ?></td>
    <?php endforeach; ?>
    </tr>
  <?php endforeach; ?>
<?php endforeach; ?>
  </tbody>
</table>
<?php endif; ?>

<!-- Other Information -->
<?php if(count($otherInfos) > 0): ?>
<h2>Other Information</h2>
<table>
  <thead>
    <tr>
    <?php foreach(array_keys($otherInfos[0][0]) as $field): ?>
      <th style="padding:5px 20px"><?php echo $field; ?></th>
    <?php endforeach; ?>
    </tr>
  </thead>
  <tbody>
<?php foreach($otherInfos as $otherInfoArray): ?>
	<?php foreach($otherInfoArray as $otherInfo): ?>
    <tr>
    <?php foreach ($otherInfo as $val): ?>
      <td><?php echo $val; ?></td>
    <?php endforeach; ?>
    </tr>
  <?php endforeach; ?>
<?php endforeach; ?>
  </tbody>
</table>
<?php endif; ?>

